import request from '@/utils/request'

// 查询物料类别列表
export function listMaterialCategory(query) {
  return request({
    url: '/systembasic/materialCategory/list',
    method: 'get',
    params: query
  })
}

// 查询产品类别下拉树结构
export function treeselect() {
    return request({
      url: '/systembasic/materialCategory/treeselect',
      method: 'get'
    })
  }

// 查询物料类别详细
export function getMaterialCategory(materialCategoryId) {
  return request({
    url: '/systembasic/materialCategory/' + materialCategoryId,
    method: 'get'
  })
}

// 新增物料类别
export function addMaterialCategory(data) {
  return request({
    url: '/systembasic/materialCategory',
    method: 'post',
    data: data
  })
}

// 修改物料类别
export function updateMaterialCategory(data) {
  return request({
    url: '/systembasic/materialCategory',
    method: 'put',
    data: data
  })
}

// 删除物料类别
export function delMaterialCategory(materialCategoryId) {
  return request({
    url: '/systembasic/materialCategory/' + materialCategoryId,
    method: 'delete'
  })
}

// 导出物料类别
export function exportMaterialCategory(query) {
  return request({
    url: '/systembasic/materialCategory/export',
    method: 'get',
    params: query
  })
}